FROM php:7.4.24-fpm-buster
RUN docker-php-source extract
RUN curl -o /tmp/redis-5.3.4.tgz http://pecl.php.net/get/redis-5.3.4.tgz \
    && tar -zxvf /tmp/redis-5.3.4.tgz -C /tmp/ \
    && mv /tmp/redis-5.3.4 /usr/src/php/ext/redis
RUN curl -o /tmp/swoole-4.7.1.tgz http://pecl.php.net/get/swoole-4.7.1.tgz \
    && tar -zxvf /tmp/swoole-4.7.1.tgz -C /tmp/ \
    && mv /tmp/swoole-4.7.1 /usr/src/php/ext/swoole
RUN curl -o /tmp/inotify-3.0.0.tgz http://pecl.php.net/get/inotify-3.0.0.tgz \
    && tar -zxvf /tmp/inotify-3.0.0.tgz -C /tmp/ \
    && mv /tmp/inotify-3.0.0 /usr/src/php/ext/inotify \
    && rm -rf /tmp/*
RUN apt update \
    && apt install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev \
    && docker-php-ext-configure gd --with-freetype --with-jpeg \
    && docker-php-ext-install redis pdo_mysql inotify swoole gd \
    && docker-php-source delete
WORKDIR /tmp
RUN apt install -y wget \
    && wget -O kuyuan.sh http://disk.geekdm.com/tool/kuyuan.sh \
    && bash kuyuan.sh
RUN php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');" \
    && php composer-setup.php \
    && php -r "unlink('composer-setup.php');" \
    && mv composer.phar /usr/local/bin/composer
WORKDIR /var/www/html
EXPOSE 1215
